package book;

public class BookList {
    private Book[] books = new Book[10];
    private int usedSize;//计数器，记录实际存放书的数目

    public BookList() {
        //构造方法，初始化成员，默认放三本书
        this.books[0] = new Book("东汉","贾复",10,"长篇袍带");
        this.books[1] = new Book("隋唐","杨林",10,"长篇袍带");
        this.books[2] = new Book("水浒","武松",10,"长篇袍带");
        this.usedSize = 3;

    }

    public Book getBook(int pos) {
        return books[pos];
    }

    public void setBooks(int pos, Book book) {
        books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
